STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Private Member Functions | List of all members
unique_ptr< _Ty[], _Dx > Class Template Reference
Inheritance diagram for unique_ptr< _Ty[], _Dx >:
_Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value >

Public Types

typedef unique_ptr< _Ty[], _Dx > _Myt
 
typedef _Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value > _Mybase
 
typedef _Mybase::pointer pointer
 
typedef _Ty element_type
 
typedef _Dx deleter_type
 

Public Member Functions

 unique_ptr () _NOEXCEPT
 
 unique_ptr (pointer _Ptr) _NOEXCEPT
 
 unique_ptr (pointer _Ptr, typename _If< is_reference< _Dx >::value, _Dx, const typename remove_reference< _Dx >::type & >::type _Dt) _NOEXCEPT
 
 unique_ptr (pointer _Ptr, typename remove_reference< _Dx >::type &&_Dt) _NOEXCEPT
 
 unique_ptr (unique_ptr &&_Right) _NOEXCEPT
 
_Mytoperator= (_Myt &&_Right) _NOEXCEPT
 
 unique_ptr (nullptr_t) _NOEXCEPT
 
_Mytoperator= (nullptr_t) _NOEXCEPT
 
void reset (nullptr_t) _NOEXCEPT
 
void swap (_Myt &_Right) _NOEXCEPT
 
 ~unique_ptr () _NOEXCEPT
 
add_reference< _Ty >::type operator[] (size_t _Idx) const
 
pointer get () const _NOEXCEPT
 
 operator bool () const _NOEXCEPT
 
pointer release () _NOEXCEPT
 
void reset (pointer _Ptr=pointer()) _NOEXCEPT
 
template<class _Ptr2 >
 unique_ptr (_Ptr2)=delete
 
template<class _Ptr2 , class _Dx2 >
 unique_ptr (_Ptr2, _Dx2)=delete
 
 unique_ptr (const _Myt &)=delete
 
_Mytoperator= (const _Myt &)=delete
 
template<class _Ptr2 >
void reset (_Ptr2)=delete
 

Private Member Functions

void _Delete ()
 
- Private Member Functions inherited from _Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value >
 _Unique_ptr_base (pointer _Ptr, _Dx _Dt)
 
 _Unique_ptr_base (pointer _Ptr)
 
 _Unique_ptr_base (_Ptr2 _Ptr, _Dx2 _Dt)
 
 _Unique_ptr_base (_Ptr2 _Ptr)
 
_Dx_norefget_deleter ()
 
const _Dx_norefget_deleter () const
 

Additional Inherited Members

- Private Types inherited from _Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value >
typedef remove_reference< _Dx >::type _Dx_noref
 
typedef _Get_deleter_pointer_type< _Ty, _Dx_noref >::type pointer
 
- Private Attributes inherited from _Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value >
pointer _Myptr
 
_Dx _Mydel
 

Member Typedef Documentation

template<class _Ty , class _Dx >
typedef _Unique_ptr_base<_Ty, _Dx, is_empty<_Dx>::value || is_same<default_delete<_Ty[]>, _Dx>::value> unique_ptr< _Ty[], _Dx >::_Mybase
template<class _Ty , class _Dx >
typedef unique_ptr<_Ty[], _Dx> unique_ptr< _Ty[], _Dx >::_Myt
template<class _Ty , class _Dx >
typedef _Dx unique_ptr< _Ty[], _Dx >::deleter_type
template<class _Ty , class _Dx >
typedef _Ty unique_ptr< _Ty[], _Dx >::element_type
template<class _Ty , class _Dx >
typedef _Mybase::pointer unique_ptr< _Ty[], _Dx >::pointer

Constructor & Destructor Documentation

template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::unique_ptr ( )
inline
1510  : _Mybase(pointer())
1511  { // default construct
1512  static_assert(!is_pointer<_Dx>::value,
1513  "unique_ptr constructed with null deleter pointer");
1514  }
_Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value > _Mybase
Definition: memory:1502
_Mybase::pointer pointer
Definition: memory:1503
Definition: type_traits:401
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::unique_ptr ( pointer  _Ptr)
inlineexplicit
1517  : _Mybase(_Ptr)
1518  { // construct with pointer
1519  static_assert(!is_pointer<_Dx>::value,
1520  "unique_ptr constructed with null deleter pointer");
1521  }
_Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value > _Mybase
Definition: memory:1502
Definition: type_traits:401
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::unique_ptr ( pointer  _Ptr,
typename _If< is_reference< _Dx >::value, _Dx, const typename remove_reference< _Dx >::type & >::type  _Dt 
)
inline
1526  : _Mybase(_Ptr, _Dt)
1527  { // construct with pointer and (maybe const) deleter&
1528  }
_Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value > _Mybase
Definition: memory:1502
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::unique_ptr ( pointer  _Ptr,
typename remove_reference< _Dx >::type &&  _Dt 
)
inline
1532  : _Mybase(_Ptr, _STD move(_Dt))
1533  { // construct by moving deleter
1534  static_assert(!is_reference<_Dx>::value,
1535  "unique_ptr constructed with reference to rvalue deleter");
1536  }
_Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value > _Mybase
Definition: memory:1502
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
Definition: type_traits:353
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::unique_ptr ( unique_ptr< _Ty[], _Dx > &&  _Right)
inline
1539  : _Mybase(_Right.release(),
1540  _STD forward<_Dx>(_Right.get_deleter()))
1541  { // construct by moving _Right
1542  }
_Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value > _Mybase
Definition: memory:1502
pointer release() _NOEXCEPT
Definition: memory:1471
_Dx_noref & get_deleter()
Definition: memory:1264
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::unique_ptr ( nullptr_t  )
inline
1555  : _Mybase(pointer())
1556  { // null pointer construct
1557  static_assert(!is_pointer<_Dx>::value,
1558  "unique_ptr constructed with null deleter pointer");
1559  }
_Unique_ptr_base< _Ty, _Dx, is_empty< _Dx >::value||is_same< default_delete< _Ty[]>, _Dx >::value > _Mybase
Definition: memory:1502
_Mybase::pointer pointer
Definition: memory:1503
Definition: type_traits:401
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::~unique_ptr ( )
inline
1579  { // destroy the object
1580  _Delete();
1581  }
void _Delete()
Definition: memory:1626
template<class _Ty , class _Dx >
template<class _Ptr2 >
unique_ptr< _Ty[], _Dx >::unique_ptr ( _Ptr2  )
explicitdelete
template<class _Ty , class _Dx >
template<class _Ptr2 , class _Dx2 >
unique_ptr< _Ty[], _Dx >::unique_ptr ( _Ptr2  ,
_Dx2   
)
delete
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::unique_ptr ( const _Myt )
delete

Member Function Documentation

template<class _Ty , class _Dx >
void unique_ptr< _Ty[], _Dx >::_Delete ( )
inlineprivate
1627  { // delete the pointer
1628  if (this->_Myptr != pointer())
1629  this->get_deleter()(this->_Myptr);
1630  }
_Mybase::pointer pointer
Definition: memory:1503
template<class _Ty , class _Dx >
pointer unique_ptr< _Ty[], _Dx >::get ( ) const
inline
1589  { // return pointer to object
1590  return (this->_Myptr);
1591  }
template<class _Ty , class _Dx >
unique_ptr< _Ty[], _Dx >::operator bool ( ) const
inlineexplicit
1594  { // test for non-null pointer
1595  return (this->_Myptr != pointer());
1596  }
_Mybase::pointer pointer
Definition: memory:1503
template<class _Ty , class _Dx >
_Myt& unique_ptr< _Ty[], _Dx >::operator= ( _Myt &&  _Right)
inline
1545  { // assign by moving _Right
1546  if (this != &_Right)
1547  { // different, do the swap
1548  reset(_Right.release());
1549  this->get_deleter() = _STD move(_Right.get_deleter());
1550  }
1551  return (*this);
1552  }
void reset(nullptr_t) _NOEXCEPT
Definition: memory:1567
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty , class _Dx >
_Myt& unique_ptr< _Ty[], _Dx >::operator= ( nullptr_t  )
inline
1562  { // assign a null pointer
1563  reset();
1564  return (*this);
1565  }
void reset(nullptr_t) _NOEXCEPT
Definition: memory:1567
template<class _Ty , class _Dx >
_Myt& unique_ptr< _Ty[], _Dx >::operator= ( const _Myt )
delete
template<class _Ty , class _Dx >
add_reference<_Ty>::type unique_ptr< _Ty[], _Dx >::operator[] ( size_t  _Idx) const
inline
1584  { // return reference to object
1585  return (this->_Myptr[_Idx]);
1586  }
template<class _Ty , class _Dx >
pointer unique_ptr< _Ty[], _Dx >::release ( )
inline
1599  { // yield ownership of pointer
1600  pointer _Ans = this->_Myptr;
1601  this->_Myptr = pointer();
1602  return (_Ans);
1603  }
_Mybase::pointer pointer
Definition: memory:1503
template<class _Ty , class _Dx >
void unique_ptr< _Ty[], _Dx >::reset ( nullptr_t  )
inline
1568  { // establish new null pointer
1569  reset();
1570  }
void reset(nullptr_t) _NOEXCEPT
Definition: memory:1567
template<class _Ty , class _Dx >
void unique_ptr< _Ty[], _Dx >::reset ( pointer  _Ptr = pointer())
inline
1606  { // establish new pointer
1607  _Delete();
1608  this->_Myptr = _Ptr;
1609  }
void _Delete()
Definition: memory:1626
template<class _Ty , class _Dx >
template<class _Ptr2 >
void unique_ptr< _Ty[], _Dx >::reset ( _Ptr2  )
delete
template<class _Ty , class _Dx >
void unique_ptr< _Ty[], _Dx >::swap ( _Myt _Right)
inline
1573  { // swap elements
1574  _Swap_adl(this->_Myptr, _Right._Myptr);
1575  _Swap_adl(this->get_deleter(), _Right.get_deleter());
1576  }
const _Ty & _Right
Definition: algorithm:4087

The documentation for this class was generated from the following file: